<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        body ,html {
            height: 100vh;
            background-color: antiquewhite;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .box {
            width: 200px;
            height: 200px;
            border: 1px solid #4d4646;
            position: relative;
        }
        .border {
            width: 100%;
            height: 100%;
            left: -2px;
            top: -2px;
            position: absolute;
            border: 2px solid transparent;
        }
    </style>
</head>
<body>

    <div class="box">
         你好欧文你
        <div class="border"></div>
    </div>

    <script>
        let box = document.querySelector('.box');
        let border = document.querySelector('.border');
        let flag = false
        box.addEventListener('click', () => {
           if(!flag)  border.style.borderColor = 'blue';
           else border.style.borderColor = 'transparent';
           flag = !flag     
        })

    </script>
    
</body>
</html>